<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage Commercial core plugins
 */


/**
 * Smarty acronymize modifier plugin
 *
 * Type:     modifier<br>
 * Name:     acronymize<br>
 * Date:     Nov 03, 2009
 * Purpose:  acronymizer
 * Input:    string
 * Example:  {$item.name|acronymize}
 *           {'���� �������� ������'|acronymize}
 * @author   Alex Yaroshevich <qfox@ya.ru>
 * @version 0.1
 * @param string with name
 * @return string
 */
function smarty_modifier_acronymize( $fulltext, $addon = null )
{
	$abbr = texo::acronyme( $fulltext );
	
	return sprintf( '<abbr title="%1$s%3$s">%2$s</abbr>', htmlentities( $fulltext, ENT_QUOTES, 'UTF-8' ), $abbr, $addon?", {$addon}":'' );
}

/* vim: set expandtab: */

?>
